package com.swallowtech.mstation.core.repository.mybatis;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.swallowtech.mstation.common.Repository.AbstractBaseRepository;
import com.swallowtech.mstation.core.domain.TagItem;
import com.swallowtech.mstation.core.repository.TagItemRepository;

@Repository
public class TagItemRepositoryImpl extends AbstractBaseRepository implements TagItemRepository {

	@Autowired
	private TagItemMapper tagItemMapper;
	

	public TagItem findByPrimaryKey(String pk) {
		return tagItemMapper.selectByPrimaryKey(pk);
	}

	public TagItem findByPrimaryKey(TagItem entity) {
		return findByPrimaryKey(entity.getId());
	}

	public Collection<TagItem> findAll() {
		throw new UnsupportedOperationException();
	}

	public int insert(TagItem entity) {
		return tagItemMapper.insert(entity);
	}

	public int update(TagItem entity) {
		return tagItemMapper.update(entity);
	}

	public int updateIngnoreNull(TagItem entity) {
		return tagItemMapper.updateIgnoreNull(entity);
	}
	
	public int deleteByPrimaryKey(String pk) {
		return tagItemMapper.deleteByPrimaryKey(pk);
	}	

}
